package com.gm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author Administrator
 * @Date 2020/6/16 11:21
 **/
@RestController
public class DempController {
    @Autowired
    JdbcTemplate jdbcTemplate;
    @GetMapping("/find")
    public Map<String,Object> findAllDem(){
      List<Map<String,Object>> list = jdbcTemplate.queryForList("select * from department");
      return list.get(0);
    }
}
